package com.lw.leetcode.other.a;

/**
 * mode
 * 1837. K 进制表示下的各位数字总和
 *
 * @Author liw
 * @Date 2021/6/18 17:22
 * @Version 1.0
 */
public class SumBase {
    public int sumBase(int n, int k) {
        int sum = 0;
        while (n > 0) {
            sum += n % k;
            n /= k;
        }
        return sum;
    }
}
